package com.ruoyi.production.service.impl.greenhousefilm;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.production.mapper.greenhousefilm.GreenhousefilmTypeMapper;
import com.ruoyi.production.domain.greenhousefilm.GreenhousefilmType;
import com.ruoyi.production.service.greenhousefilm.IGreenhousefilmTypeService;

/**
 * 棚膜类型(长*宽)Service业务层处理
 *
 * @author ruoyi
 * @date 2021-07-12
 */
@Service
public class GreenhousefilmTypeServiceImpl implements IGreenhousefilmTypeService
{
    @Autowired
    private GreenhousefilmTypeMapper greenhousefilmTypeMapper;

    /**
     * 查询棚膜类型(长*宽)
     *
     * @param greenhousefilmTypeId 棚膜类型(长*宽)ID
     * @return 棚膜类型(长*宽)
     */
    @Override
    public GreenhousefilmType selectGreenhousefilmTypeById(Long greenhousefilmTypeId)
    {
        return greenhousefilmTypeMapper.selectGreenhousefilmTypeById(greenhousefilmTypeId);
    }

    /**
     * 查询棚膜类型(长*宽)列表
     *
     * @param greenhousefilmType 棚膜类型(长*宽)
     * @return 棚膜类型(长*宽)
     */
    @Override
    public List<GreenhousefilmType> selectGreenhousefilmTypeList(GreenhousefilmType greenhousefilmType)
    {
        return greenhousefilmTypeMapper.selectGreenhousefilmTypeList(greenhousefilmType);
    }

    /**
     * 新增棚膜类型(长*宽)
     *
     * @param greenhousefilmType 棚膜类型(长*宽)
     * @return 结果
     */
    @Override
    public int insertGreenhousefilmType(GreenhousefilmType greenhousefilmType)
    {
        greenhousefilmType.setCreateTime(DateUtils.getNowDate());
        return greenhousefilmTypeMapper.insertGreenhousefilmType(greenhousefilmType);
    }

    /**
     * 修改棚膜类型(长*宽)
     *
     * @param greenhousefilmType 棚膜类型(长*宽)
     * @return 结果
     */
    @Override
    public int updateGreenhousefilmType(GreenhousefilmType greenhousefilmType)
    {
        greenhousefilmType.setUpdateTime(DateUtils.getNowDate());
        return greenhousefilmTypeMapper.updateGreenhousefilmType(greenhousefilmType);
    }

    /**
     * 批量删除棚膜类型(长*宽)
     *
     * @param greenhousefilmTypeIds 需要删除的棚膜类型(长*宽)ID
     * @return 结果
     */
    @Override
    public int deleteGreenhousefilmTypeByIds(Long[] greenhousefilmTypeIds)
    {
        return greenhousefilmTypeMapper.deleteGreenhousefilmTypeByIds(greenhousefilmTypeIds);
    }

    /**
     * 删除棚膜类型(长*宽)信息
     *
     * @param greenhousefilmTypeId 棚膜类型(长*宽)ID
     * @return 结果
     */
    @Override
    public int deleteGreenhousefilmTypeById(Long greenhousefilmTypeId)
    {
        return greenhousefilmTypeMapper.deleteGreenhousefilmTypeById(greenhousefilmTypeId);
    }
}
